package com.dyw.springboot;


import com.dyw.springboot.entity.Car;
import com.dyw.springboot.entity.ME;
import com.dyw.springboot.entity.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SuppressWarnings("all")
@SpringBootApplication
public class Springboot09AnnoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Springboot09AnnoApplication.class, args);
        User bean = context.getBean(User.class);
        System.out.println(bean);


        Car bean1 = context.getBean(Car.class);
        System.out.println(bean1.getName());
        System.out.println(bean1.getPrice());

        ME bean2 = context.getBean(ME.class);
        System.out.println(bean2.getName());
        System.out.println(bean2.getAge());
        String[] life = bean2.getLife();
        for (String s : life) {
            System.out.println(s);
        }
    }

}
